package com.test.common.repository.perf;

import com.test.common.entity.perf.PerfTaskEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface PerfTaskRepository extends JpaRepository<PerfTaskEntity, Integer> {
    Page<PerfTaskEntity> findAllByCreator(String creator, Pageable pageable);

    Page<PerfTaskEntity> findAllByNameContains(String taskName, Pageable pageable);

    Page<PerfTaskEntity> findAllByNameContainsAndCreator(String taskName, String creator, Pageable pageable);

    Page<PerfTaskEntity> findAllByIdIn(List<Integer> idList, Pageable pageable);

    Page<PerfTaskEntity> findAllByIdInAndCreator(List<Integer> idList, String creator, Pageable pageable);

    Page<PerfTaskEntity> findAllByIdInAndNameContains(List<Integer> idList, String taskName, Pageable pageable);

    Page<PerfTaskEntity> findAllByIdInAndNameContainsAndCreator(List<Integer> idList, String taskName, String creator, Pageable pageable);
}
